using System;
using System.Collections;
using System.Collections.Generic;
namespace Circus.Syntax.Lexer
{
	public class LexSyntaxBlocks : List<LexSyntaxBlock>
	{
		private LexState state;
		public LexSyntaxBlocks(LexState state)
		{
			this.state = state;
		}
		public virtual LexSyntaxBlock AddLexSyntaxBlock()
		{
			LexSyntaxBlock lexSyntaxBlock = new LexSyntaxBlock(this.state);
			base.Add(lexSyntaxBlock);
			return lexSyntaxBlock;
		}
		public virtual LexSyntaxBlock InsertLexSyntaxBlock(int index)
		{
			LexSyntaxBlock lexSyntaxBlock = new LexSyntaxBlock();
			base.Insert(index, lexSyntaxBlock);
			return lexSyntaxBlock;
		}
		public virtual LexSyntaxBlock FindSyntaxBlock(string name)
		{
			LexSyntaxBlock result;
			foreach (LexSyntaxBlock current in this)
			{
				if (current.Name == name)
				{
					result = current;
					return result;
				}
			}
			result = null;
			return result;
		}
	}
}
